all: ipuck cpuck test

setup:
	@echo "Exporting lib"
	export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so

ipuck:
	@echo 	
	@echo Building iPuck: homography tool	
	g++ -g3 -Iinclude `pkg-config --cflags opencv` `pkg-config --libs opencv` -o iPuck ePuck.cpp iPuck.cpp Generic.cpp Control.cpp Vision.cpp
 

# -L/home/tim/libpng-1.4.3/.libs -Xlinker -R . -lpng14 
ipuck_cuda:
	@echo 	
	@echo Building iPuck-cuda servert: homography tool	
	g++ /home/tim/5HC99/src/ePuck/SURFGPU-1.0.1/CMakeFiles/surf.dir/fasthessian.cpp.o SURFGPU-1.0.1/CMakeFiles/surf.dir/helper_funcs.cpp.o SURFGPU-1.0.1/CMakeFiles/surf.dir/integral.cpp.o SURFGPU-1.0.1/CMakeFiles/surf.dir/ipoint.cpp.o SURFGPU-1.0.1/CMakeFiles/surf.dir/surf.cpp.o SURFGPU-1.0.1/CMakeFiles/surf.dir/utils.cpp.o SURFGPU-1.0.1/CMakeFiles/surf.dir/cuda/getMatchesGPU.cpp.o SURFGPU-1.0.1/CMakeFiles/surf.dir/./surf_generated_buildSURFDescriptorsGPU.cu.o SURFGPU-1.0.1/CMakeFiles/surf.dir/./surf_generated_convertRGB2GrayFloatGPU.cu.o SURFGPU-1.0.1/CMakeFiles/surf.dir/./surf_generated_detectIpointOrientationsGPU.cu.o SURFGPU-1.0.1/CMakeFiles/surf.dir/./surf_generated_buildDetGPU.cu.o SURFGPU-1.0.1/CMakeFiles/surf.dir/./surf_generated_nonMaxGPU.cu.o SURFGPU-1.0.1/CMakeFiles/surf.dir/./surf_generated_matchSURFKeypointsGPU.cu.o SURFGPU-1.0.1/CMakeFiles/surf.dir/./surf_generated_normalizeSURFDescriptorsGPU.cu.o SURFGPU-1.0.1/CMakeFiles/surf.dir/./surf_generated_transposeGPU.cu.o -rdynamic -L/home/tim/nvidia/cudasdk/common/lib/linux /usr/local/cuda/lib/libcudart.so -lcuda /usr/local/cuda/lib/libcudart.so -lcuda -lcvaux -lcuda /home/tim/nvidia/cudasdk/C/lib/libcutil_i386.a /usr/local/cuda/lib/libcudart.so -lcuda /home/tim/nvidia/cudasdk/C/lib/libcutil_i386.a -lcuda /home/tim/nvidia/cudasdk/C/common/lib/linux/libcudpp_i386.a -Iinclude -I/home/tim/nvidia/cudasdk/C/common/inc/ -I/usr/local/cuda/include/ -I/home/tim/opencv/include/ -I/home/tim/opencv/include/opencv -L/home/tim/opencv/lib -Xlinker -R . -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann -lhighgui -lcvaux -lcv -lml -lcxcore -g -o iPuck_cuda ePuck.cpp iPuck.cpp Generic.cpp Control.cpp Vision.cpp

ipuck_d:
	@echo 	
	@echo Building iPuck_d: homography tool	
	g++ -Iinclude `pkg-config --cflags opencv` `pkg-config --libs opencv` -g3 -o iPuck_d ePuck.cpp iPuck.cpp Generic.cpp Control.cpp Vision.cpp

test:
	@echo 	
	@echo Building ePuck library tester	
	g++ -Iinclude -L../lib -I../include -Wall -o ePuck_test ePuck.cpp main.cpp

cpuck:
	@echo 	
	@echo Building cPuck: direct controller tool	
	g++ -Iinclude -L../lib -I../include -Wall -o cPuck ePuck.cpp cPuck.cpp

clean:
	rm -Rf iPuck ePuck_test cPuck iPuck_d iPuck_cuda
